Left Termination of the query pattern perm_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

perm([], []).
perm(L, .(H, T)) :- ','(append2(V, .(H, U), L), ','(append1(V, U, W), perm(W, T))).
append1([], L, L).
append1(.(H, L1), L2, .(H, L3)) :- append1(L1, L2, L3).
append2([], L, L).
append2(.(H, L1), L2, .(H, L3)) :- append2(L1, L2, L3).

Queries:

perm(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(L, .(H, T)) → U1(L, H, T, append2_in(V, .(H, U), L))
append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U1(L, H, T, append2_out(V, .(H, U), L)) → U2(L, H, T, append1_in(V, U, W))
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))
U2(L, H, T, append1_out(V, U, W)) → U3(L, H, T, perm_in(W, T))
perm_in([], []) → perm_out([], [])
U3(L, H, T, perm_out(W, T)) → perm_out(L, .(H, T))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
U2(x1, x2, x3, x4)  =  U2(x4)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(L, .(H, T)) → U1(L, H, T, append2_in(V, .(H, U), L))
append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U1(L, H, T, append2_out(V, .(H, U), L)) → U2(L, H, T, append1_in(V, U, W))
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))
U2(L, H, T, append1_out(V, U, W)) → U3(L, H, T, perm_in(W, T))
perm_in([], []) → perm_out([], [])
U3(L, H, T, perm_out(W, T)) → perm_out(L, .(H, T))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
U2(x1, x2, x3, x4)  =  U2(x4)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(L, .(H, T)) → U11(L, H, T, append2_in(V, .(H, U), L))
PERM_IN(L, .(H, T)) → APPEND2_IN(V, .(H, U), L)
APPEND2_IN(.(H, L1), L2, .(H, L3)) → U51(H, L1, L2, L3, append2_in(L1, L2, L3))
APPEND2_IN(.(H, L1), L2, .(H, L3)) → APPEND2_IN(L1, L2, L3)
U11(L, H, T, append2_out(V, .(H, U), L)) → U21(L, H, T, append1_in(V, U, W))
U11(L, H, T, append2_out(V, .(H, U), L)) → APPEND1_IN(V, U, W)
APPEND1_IN(.(H, L1), L2, .(H, L3)) → U41(H, L1, L2, L3, append1_in(L1, L2, L3))
APPEND1_IN(.(H, L1), L2, .(H, L3)) → APPEND1_IN(L1, L2, L3)
U21(L, H, T, append1_out(V, U, W)) → U31(L, H, T, perm_in(W, T))
U21(L, H, T, append1_out(V, U, W)) → PERM_IN(W, T)

The TRS R consists of the following rules:

perm_in(L, .(H, T)) → U1(L, H, T, append2_in(V, .(H, U), L))
append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U1(L, H, T, append2_out(V, .(H, U), L)) → U2(L, H, T, append1_in(V, U, W))
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))
U2(L, H, T, append1_out(V, U, W)) → U3(L, H, T, perm_in(W, T))
perm_in([], []) → perm_out([], [])
U3(L, H, T, perm_out(W, T)) → perm_out(L, .(H, T))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
U2(x1, x2, x3, x4)  =  U2(x4)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U31(x1, x2, x3, x4)  =  U31(x4)
APPEND1_IN(x1, x2, x3)  =  APPEND1_IN(x1, x2)
U51(x1, x2, x3, x4, x5)  =  U51(x5)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
APPEND2_IN(x1, x2, x3)  =  APPEND2_IN(x3)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(L, .(H, T)) → U11(L, H, T, append2_in(V, .(H, U), L))
PERM_IN(L, .(H, T)) → APPEND2_IN(V, .(H, U), L)
APPEND2_IN(.(H, L1), L2, .(H, L3)) → U51(H, L1, L2, L3, append2_in(L1, L2, L3))
APPEND2_IN(.(H, L1), L2, .(H, L3)) → APPEND2_IN(L1, L2, L3)
U11(L, H, T, append2_out(V, .(H, U), L)) → U21(L, H, T, append1_in(V, U, W))
U11(L, H, T, append2_out(V, .(H, U), L)) → APPEND1_IN(V, U, W)
APPEND1_IN(.(H, L1), L2, .(H, L3)) → U41(H, L1, L2, L3, append1_in(L1, L2, L3))
APPEND1_IN(.(H, L1), L2, .(H, L3)) → APPEND1_IN(L1, L2, L3)
U21(L, H, T, append1_out(V, U, W)) → U31(L, H, T, perm_in(W, T))
U21(L, H, T, append1_out(V, U, W)) → PERM_IN(W, T)

The TRS R consists of the following rules:

perm_in(L, .(H, T)) → U1(L, H, T, append2_in(V, .(H, U), L))
append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U1(L, H, T, append2_out(V, .(H, U), L)) → U2(L, H, T, append1_in(V, U, W))
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))
U2(L, H, T, append1_out(V, U, W)) → U3(L, H, T, perm_in(W, T))
perm_in([], []) → perm_out([], [])
U3(L, H, T, perm_out(W, T)) → perm_out(L, .(H, T))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
U2(x1, x2, x3, x4)  =  U2(x4)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U31(x1, x2, x3, x4)  =  U31(x4)
APPEND1_IN(x1, x2, x3)  =  APPEND1_IN(x1, x2)
U51(x1, x2, x3, x4, x5)  =  U51(x5)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
APPEND2_IN(x1, x2, x3)  =  APPEND2_IN(x3)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 5 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND1_IN(.(H, L1), L2, .(H, L3)) → APPEND1_IN(L1, L2, L3)

The TRS R consists of the following rules:

perm_in(L, .(H, T)) → U1(L, H, T, append2_in(V, .(H, U), L))
append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U1(L, H, T, append2_out(V, .(H, U), L)) → U2(L, H, T, append1_in(V, U, W))
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))
U2(L, H, T, append1_out(V, U, W)) → U3(L, H, T, perm_in(W, T))
perm_in([], []) → perm_out([], [])
U3(L, H, T, perm_out(W, T)) → perm_out(L, .(H, T))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
U2(x1, x2, x3, x4)  =  U2(x4)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
APPEND1_IN(x1, x2, x3)  =  APPEND1_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND1_IN(.(H, L1), L2, .(H, L3)) → APPEND1_IN(L1, L2, L3)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
APPEND1_IN(x1, x2, x3)  =  APPEND1_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND1_IN(.(L1), L2) → APPEND1_IN(L1, L2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND2_IN(.(H, L1), L2, .(H, L3)) → APPEND2_IN(L1, L2, L3)

The TRS R consists of the following rules:

perm_in(L, .(H, T)) → U1(L, H, T, append2_in(V, .(H, U), L))
append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U1(L, H, T, append2_out(V, .(H, U), L)) → U2(L, H, T, append1_in(V, U, W))
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))
U2(L, H, T, append1_out(V, U, W)) → U3(L, H, T, perm_in(W, T))
perm_in([], []) → perm_out([], [])
U3(L, H, T, perm_out(W, T)) → perm_out(L, .(H, T))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
U2(x1, x2, x3, x4)  =  U2(x4)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
APPEND2_IN(x1, x2, x3)  =  APPEND2_IN(x3)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND2_IN(.(H, L1), L2, .(H, L3)) → APPEND2_IN(L1, L2, L3)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
APPEND2_IN(x1, x2, x3)  =  APPEND2_IN(x3)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND2_IN(.(L3)) → APPEND2_IN(L3)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(L, .(H, T)) → U11(L, H, T, append2_in(V, .(H, U), L))
U11(L, H, T, append2_out(V, .(H, U), L)) → U21(L, H, T, append1_in(V, U, W))
U21(L, H, T, append1_out(V, U, W)) → PERM_IN(W, T)

The TRS R consists of the following rules:

perm_in(L, .(H, T)) → U1(L, H, T, append2_in(V, .(H, U), L))
append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U1(L, H, T, append2_out(V, .(H, U), L)) → U2(L, H, T, append1_in(V, U, W))
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))
U2(L, H, T, append1_out(V, U, W)) → U3(L, H, T, perm_in(W, T))
perm_in([], []) → perm_out([], [])
U3(L, H, T, perm_out(W, T)) → perm_out(L, .(H, T))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
.(x1, x2)  =  .(x2)
U1(x1, x2, x3, x4)  =  U1(x4)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
U2(x1, x2, x3, x4)  =  U2(x4)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U3(x1, x2, x3, x4)  =  U3(x4)
perm_out(x1, x2)  =  perm_out(x2)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(L, .(H, T)) → U11(L, H, T, append2_in(V, .(H, U), L))
U11(L, H, T, append2_out(V, .(H, U), L)) → U21(L, H, T, append1_in(V, U, W))
U21(L, H, T, append1_out(V, U, W)) → PERM_IN(W, T)

The TRS R consists of the following rules:

append2_in(.(H, L1), L2, .(H, L3)) → U5(H, L1, L2, L3, append2_in(L1, L2, L3))
append2_in([], L, L) → append2_out([], L, L)
append1_in(.(H, L1), L2, .(H, L3)) → U4(H, L1, L2, L3, append1_in(L1, L2, L3))
append1_in([], L, L) → append1_out([], L, L)
U5(H, L1, L2, L3, append2_out(L1, L2, L3)) → append2_out(.(H, L1), L2, .(H, L3))
U4(H, L1, L2, L3, append1_out(L1, L2, L3)) → append1_out(.(H, L1), L2, .(H, L3))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
append2_in(x1, x2, x3)  =  append2_in(x3)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
[]  =  []
append2_out(x1, x2, x3)  =  append2_out(x1, x2)
append1_in(x1, x2, x3)  =  append1_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
append1_out(x1, x2, x3)  =  append1_out(x3)
U21(x1, x2, x3, x4)  =  U21(x4)
PERM_IN(x1, x2)  =  PERM_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ RuleRemovalProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN(L) → U11(append2_in(L))
U21(append1_out(W)) → PERM_IN(W)
U11(append2_out(V, .(U))) → U21(append1_in(V, U))

The TRS R consists of the following rules:

append2_in(.(L3)) → U5(append2_in(L3))
append2_in(L) → append2_out([], L)
append1_in(.(L1), L2) → U4(append1_in(L1, L2))
append1_in([], L) → append1_out(L)
U5(append2_out(L1, L2)) → append2_out(.(L1), L2)
U4(append1_out(L3)) → append1_out(.(L3))

The set Q consists of the following terms:

append2_in(x0)
append1_in(x0, x1)
U5(x0)
U4(x0)

We have to consider all (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

U21(append1_out(W)) → PERM_IN(W)

Strictly oriented rules of the TRS R:

append2_in(L) → append2_out([], L)

Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1)) = 2 + x1   
POL(PERM_IN(x1)) = 2 + 2·x1   
POL(U11(x1)) = 2·x1   
POL(U21(x1)) = 2·x1   
POL(U4(x1)) = 2 + x1   
POL(U5(x1)) = 2 + x1   
POL([]) = 0   
POL(append1_in(x1, x2)) = 2 + x1 + x2   
POL(append1_out(x1)) = 2 + x1   
POL(append2_in(x1)) = 1 + x1   
POL(append2_out(x1, x2)) = x1 + x2   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN(L) → U11(append2_in(L))
U11(append2_out(V, .(U))) → U21(append1_in(V, U))

The TRS R consists of the following rules:

append2_in(.(L3)) → U5(append2_in(L3))
append1_in(.(L1), L2) → U4(append1_in(L1, L2))
append1_in([], L) → append1_out(L)
U5(append2_out(L1, L2)) → append2_out(.(L1), L2)
U4(append1_out(L3)) → append1_out(.(L3))

The set Q consists of the following terms:

append2_in(x0)
append1_in(x0, x1)
U5(x0)
U4(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.